package cn.ztr.ymcc.feign.impl;

import cn.ztr.ymcc.feign.EmployeeFeign;
import cn.ztr.ymcc.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class EmployeeFeignImpl implements FallbackFactory<EmployeeFeign> {
    @Override
    public EmployeeFeign create(Throwable throwable) {
        return new EmployeeFeign() {
            @Override
            public JsonResult get(Long id) {
                return JsonResult.error("查询员工失败");
            }

            @Override
            public JsonResult getByLoginId(Long id) {
                return JsonResult.error("通过loginid查询员工失败");
            }
        };
    }
}
